package com.iscas.green.httpclienttest.httpclient;

import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

@Service
public class RestTemplateService {
    private static final String URL = "http://database-test.chaos-test.svc.cluster.local:8080/api/test/clickhouse";

    public String callService() {
        RestTemplate restTemplate = new RestTemplate();
        try {
            return restTemplate.getForObject(URL, String.class);
        } catch (Exception e) {
            e.printStackTrace();
            return "Error: " + e.getMessage();
        }
    }
}
